package com.kingmed.kmss.framework.feign.client.dict;


import com.kingmed.kmss.common.dto.admin.sys.SysDataDictDTO;
import com.kingmed.kmss.common.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "kmss-admin", url = "${internalService.adminService.url}", contextId = "common-admin-dict-interface", fallbackFactory = DictFeignFallbackService.class)
public interface DictFeignService {

    /**
     * 根据字典类型code查字典数据
     */
    @GetMapping(value = "/admin/sys/dict/queryByCode")
    CommonResponse<List<SysDataDictDTO>> querySysDataDictByCode(@RequestParam String dictCode);

    /**
     * 取出字典表所有字典数据
     */
    @GetMapping(value = "/admin/sys/dict/query")
    CommonResponse<List<SysDataDictDTO>> queryAllSysDataDict(@RequestBody SysDataDictDTO params);


    /**
     * 批量查询字典数据
     */
    @PostMapping(value = "/admin/sys/dict/queryByCodeBatch")
    CommonResponse<Map<String, List<SysDataDictDTO>>> queryByCodeBatch(@RequestBody List<String> dictCodes);


}
